import 'package:json_annotation/json_annotation.dart';

/// pageNum : 1
/// pageSize : 10
/// total : 3
/// pages : 1
/// list : null
/// emptyFlag : false

part 'page.g.dart';

@JsonSerializable(genericArgumentFactories: true)
class Page<T> {
  Page({
    this.pageNum,
    this.pageSize,
    this.total,
    this.pages,
    this.list,
    this.emptyFlag,
  });

  num? pageNum;
  num? pageSize;
  num? total;
  num? pages;
  List<T>? list;
  bool? emptyFlag;

  factory Page.fromJson(
          Map<String, dynamic> json, T Function(dynamic json) fromJsonT) =>
      _$PageFromJson(json, fromJsonT);

  Map<String, dynamic> toJson(Object? Function(T value) toJsonT) =>
      _$PageToJson(this, toJsonT);
}
